require.mx('mxjs/mesh/octree.js');
This is the octree generation library.
Status | Name |
---|---|
Constant |
Number BF_INTERSECTED
box flag indicating that a box intersected the mesh |
Constant |
Number BF_NONE
empty box flags |
Constant |
Number BF_SUBDIVIDED
box flag indicating that a box was subdivided |
copyBoxCentre
(
vec3 ↑outLocation,
Object ↓boxes,
Number ↓idx
)
|
|
generateSteppedOctree
(
Object settings
)
|
|
wasBoxIntersected
(
Object ↓boxes,
Number ↓idx
)
|
|
wasBoxSubdivided
(
Object ↓boxes,
Number ↓idx
)
|
Parameters:
Object
settings - settings for the octree generation. resolution
a number specifying the size of the minimum cubes to generate. mesh
a LibMeshTA mesh object containing the mesh to divide space around. boundingMin
and boundingMax
, vectors specifying the minimum point and maximum point of the volume to divide (an axis aligned cuboid). generateNearbySteps
determines whether blocks are subdivided near (but not intersecting) the mesh, used to generate staggered cube size increases around the mesh (e.g. for generate numerical modelling analysis points), defaults to false
. calculateIntersections
determines whether the intersect flag should be calculated for the final level of cubes, defaults to true
. levelSteps
an optional array specifying hopeful numbers of the levels of cubes for each size level, as moving away from the mesh, e.g. [4, 2, 2]
would aim to create four layers of minimum size cubes, two layers of the next size cube, and two layers of the third size - unspecified levels are assumed to be 1
. Note that the real number of layers generated is highly dependent on the position within the volume due to how the octree is divided.